package yf.mall.vo.down;


import lombok.Data;

import java.util.Date;

import com.alibaba.excel.annotation.*;

import java.io.Serializable;


import java.math.BigDecimal;

import yf.mall.entity.KolProductEntity;
import yf.mall.vo.KolProductVo;

import yf.mall.enums.KolProductAssuredEnum;
import yf.mall.enums.KolProductSxtEnum;
import yf.mall.enums.KolProductSharableEnum;
import yf.mall.enums.KolProductRecommendEnum;
import yf.mall.enums.KolProductInStockEnum;

/**
 * 商品信息表实体
 * 表名 kol_product
 *
 *
 *
 * @date Thu Aug 24 21:27:51 CST 2023
 */
@Data
public class KolProductDown implements Serializable {
    @ExcelIgnore
    private static final long serialVersionUID = 1L;

    //商品id
    @ExcelProperty("商品id")
    private Long id;

    //商品标题
    @ExcelProperty("商品标题")
    private String title;

    //商品一级类目
    @ExcelProperty("商品一级类目")
    private Long firstCid;

    //商品二级类目
    @ExcelProperty("商品二级类目")
    private Long secondCid;

    //商品三级类目
    @ExcelProperty("商品三级类目")
    private Long thirdCid;

    //历史总销量
    @ExcelProperty("历史总销量")
    private Long sales;

    //IMG-商品主图
    @ExcelProperty("IMG-商品主图")
    private String cover;

    //轮播图urls
    @ExcelProperty("轮播图urls")
    private String coverImgMaterialUrl;

    //商品链接（普通计划链接）
    @ExcelProperty("商品链接（普通计划链接）")
    private String url;

    //店铺id
    @ExcelProperty("店铺id")
    private Long shopId;

    //商品售价（单位为分）
    @ExcelProperty("商品售价（单位为分）")
    private BigDecimal price;

    //普通佣金比例（乘100，例如10%为10）
    @ExcelProperty("普通佣金比例（乘100，例如10%为10）")
    private Integer cosRatio;

    //普通佣金金额（单位为分）
    @ExcelProperty("普通佣金金额（单位为分）")
    private BigDecimal cosFee;

    //达人佣金比例（乘100，例如10%为10）
    @ExcelProperty("达人佣金比例（乘100，例如10%为10）")
    private Integer kolCosRatio;

    //达人佣金金额（单位为分）
    @ExcelProperty("达人佣金金额（单位为分）")
    private BigDecimal kolCosFee;

    //商品评分（5分制，保留一位）
    @ExcelProperty("商品评分（5分制，保留一位）")
    private BigDecimal commentScore;

    //商品评价数目
    @ExcelProperty("商品评价数目")
    private Long commentNum;

    //近30天商品总订单量
    @ExcelProperty("近30天商品总订单量")
    private Long orderNum;

    //近30天商品总浏览量
    @ExcelProperty("近30天商品总浏览量")
    private Long viewNum;

    //近30天推广总达人数
    @ExcelProperty("近30天推广总达人数")
    private Long kolNum;

    //营销分类
    @ExcelProperty("营销分类")
    private Integer marketType;

    //行业类目
    @ExcelProperty("行业类目")
    private String categoryName;

    //商品物流说明(没有物流说明返回空字符串)
    @ExcelProperty("商品物流说明(没有物流说明返回空字符串)")
    private String logisticsInfo;

    //ENUM-是否提供安心购服务:"NO-否","YES-是"
    @ExcelIgnore
    private Integer assured;
    @ExcelProperty("是否提供安心购服务")
    private String assuredStr;

    //ENUM-是否具有短视频随心推资质:"NO-否","YES-是"
    @ExcelIgnore
    private Integer sxt;
    @ExcelProperty("是否具有短视频随心推资质")
    private String sxtStr;

    //ENUM-是否可分销:"NO-否","YES-是"
    @ExcelIgnore
    private Integer sharable;
    @ExcelProperty("是否可分销")
    private String sharableStr;

    //ENUM-是否精选:"NO-否","YES-是"
    @ExcelIgnore
    private Integer recommend;
    @ExcelProperty("是否精选")
    private String recommendStr;

    //详情图片urls
    @ExcelProperty("详情图片urls")
    private String detailImgMaterialUrl;

    //最后修改时间
    @ExcelProperty("最后修改时间")
    private Date updateTime;

    //推广文案
    @ExcelProperty("推广文案")
    private String promotion;

    //视频链接
    @ExcelProperty("视频链接")
    private String videoUrl;

    //内部产品分类
    @ExcelProperty("内部产品分类")
    private Integer type;

    //添加时间
    @ExcelProperty("添加时间")
    private Date addTime;

    //近7天商品销量
    @ExcelProperty("近7天商品销量")
    private Long saleOf7;

    //今日商品销量
    @ExcelProperty("今日商品销量")
    private Long saleOfToday;

    //ENUM-是否可添加橱窗:"NO-否","YES-是"
    @ExcelIgnore
    private Integer inStock;
    @ExcelProperty("是否可添加橱窗")
    private String inStockStr;


    public KolProductDown() {

    }

    public KolProductDown(KolProductVo vo) {
        KolProductEntity entity = vo.getEntity();
        this.setId(entity.getId());

        this.setTitle(entity.getTitle());

        this.setFirstCid(entity.getFirstCid());

        this.setSecondCid(entity.getSecondCid());

        this.setThirdCid(entity.getThirdCid());

        this.setSales(entity.getSales());

        this.setCover(entity.getCover());

        this.setCoverImgMaterialUrl(entity.getCoverImgMaterialUrl());

        this.setUrl(entity.getUrl());

        this.setShopId(entity.getShopId());

        this.setPrice(entity.getPrice());

        this.setCosRatio(entity.getCosRatio());

        this.setCosFee(entity.getCosFee());

        this.setKolCosRatio(entity.getKolCosRatio());

        this.setKolCosFee(entity.getKolCosFee());

        this.setCommentScore(entity.getCommentScore());

        this.setCommentNum(entity.getCommentNum());

        this.setOrderNum(entity.getOrderNum());

        this.setViewNum(entity.getViewNum());

        this.setKolNum(entity.getKolNum());

        this.setMarketType(entity.getMarketType());

        this.setCategoryName(entity.getCategoryName());

        this.setLogisticsInfo(entity.getLogisticsInfo());

        this.setAssured(entity.getAssured());
        if (entity.getAssured() != null) {
            this.setAssuredStr(KolProductAssuredEnum.indexOf(entity.getAssured()));
        }

        this.setSxt(entity.getSxt());
        if (entity.getSxt() != null) {
            this.setSxtStr(KolProductSxtEnum.indexOf(entity.getSxt()));
        }

        this.setSharable(entity.getSharable());
        if (entity.getSharable() != null) {
            this.setSharableStr(KolProductSharableEnum.indexOf(entity.getSharable()));
        }

        this.setRecommend(entity.getRecommend());
        if (entity.getRecommend() != null) {
            this.setRecommendStr(KolProductRecommendEnum.indexOf(entity.getRecommend()));
        }

        this.setDetailImgMaterialUrl(entity.getDetailImgMaterialUrl());

        this.setUpdateTime(entity.getUpdateTime());

        this.setPromotion(entity.getPromotion());

        this.setVideoUrl(entity.getVideoUrl());

        this.setType(entity.getType());

        this.setAddTime(entity.getAddTime());

        this.setSaleOf7(entity.getSaleOf7());

        this.setSaleOfToday(entity.getSaleOfToday());

        this.setInStock(entity.getInStock());
        if (entity.getInStock() != null) {
            this.setInStockStr(KolProductInStockEnum.indexOf(entity.getInStock()));
        }

    }


}
